package com.weasel.im.client.handler;

import com.weasel.im.common.domain.Message;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;


/**
 * Created by Dylan on 2015/11/27.
 */
public class IMClientHandler extends SimpleChannelInboundHandler<Message> {


    @Override
    protected void messageReceived(ChannelHandlerContext channelHandlerContext, Message message) throws Exception {

        System.out.println("                                     {"+message.getFrom() + "}对你说 :"+ message.getContent());
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        //do nothing
        super.exceptionCaught(ctx, cause);
    }
}
